package main

func hammingWeight(num uint32) int {
	n := 0
	for num > 0 {
		if num&1 > 0 {
			n++
		}
		num = num >> 1
	}
	return n
}

func main() {
	println(hammingWeight(0b00000000000000000000000000001000))
}
